import SwitchPlatform from './component/SwitchPlatform';
import { PlatformStyleType } from '@/types/ModelType';
import { ACTION_TYPES } from '@/models';

export interface PlatformMenusType {
  [platformName: string]: PlatformStyleType
}

const platformMenus: PlatformMenusType = {
  'iPhone5/SE': [320, 568],
  'iPhone6/7/8': [375, 667],
  'iPhoneX': [375, 812],
  'iPad': [765, 1024],
  'iPad Pro': [1024, 1366],
};

/**
 * 工具栏配置
 */
export default [{
  span: 8,
  style: { justifyContent: 'flex-end' },
  group: [
    { title: 'undo', icon: 'undo', shortcutKey: 'command+z/control+z', type: ACTION_TYPES.undo },
    { title: 'redo', icon: 'redo', shortcutKey: 'command+shift+z/control+shift+z', type: ACTION_TYPES.redo },
    // {title:'属性重做',icon:'shuxing',event:'resetProps'},
    { title: 'resetStyle', icon: 'form', type: ACTION_TYPES.changeStyles },
  ],
}, {
  span: 8,
  style: { justifyContent: 'flex-end' },
  group: [
    { title: 'preview', icon: 'eye' },
    // { title: '导出代码', icon: 'export', event: 'outputFiles' },
    { title: 'generateTemplate', icon: 'block' },
    { title: 'switchPlatform', icon: SwitchPlatform, props: { menus: platformMenus } },
  ],
},
  {
    span: 8,
    style: { justifyContent: 'flex-end', paddingRight: '50px' },
    group: [
      { title: 'save', icon: 'save', type: ACTION_TYPES.submitConfigs },
      { title: 'copy', icon: 'copy', type: ACTION_TYPES.copyComponent },
      { title: 'clear', icon: 'rest', type: ACTION_TYPES.clearChildNodes },
      { title: 'delete', icon: 'delete', type: ACTION_TYPES.deleteComponent },

    ],
  }];


export const ENABLED = {
  selected: ['copy', 'delete', 'generateTemplate'],
  must: ['preview', 'save'],
};

export const CONTEXT_MENU = ['copy', 'clear', 'delete'];

export const DefaultImgBase64 = '';
